<?php
$view_post = '<div class="boxleft"><div class="titleleft"></div><div class="titlecenter"><a href="'.$row_menu_one['url'].'">'.$row_menu_one['name'].'</a></div><div class="titleright"></div><div class="titleicon"></div><div style="clear:both; height:1px"></div><div id="chuongtrinh">';
if(!@$_GET['detail']){
	$view_post .= '<h1>'.$row_menu_one['title'].'</h1><h2 style="color:#666; font-size:13px; font-weight:100; margin:0 20px; padding-bottom:30px">'.$row_menu_one['metaDescription'].'</h2>';
	
	$from = (($page - 1) * max_video);
	$select = 'id,name,name_rewrite,url_hinh,description,menu_id';
	$table = 'video';
	$where = "`delete`=0 AND status=1 AND menu_id LIKE '%,{$idMenu},%'";
	$limit = "LIMIT {$from},".max_video;
	$list = $tc->list_item($select,$table,$where,$limit);
	while($row = mysql_fetch_array($list)){
		$view_post .= '
		<div class="item">
			<a href="'.$tc->link_detail($row['menu_id']).$row['name_rewrite'].'.html"><h2>'.$row['name'].'</h2></a>
			<img src="'.url_video_thumb_image.$row['url_hinh'].'" alt="'.$row['name'].'" />
			<h5>'.$row['description'].'</h5>
		</div>';
	}
	$phantrang = $tc->phantrang($row_menu_one['url'],$page,max_video,'id',$table,$where);
	$view_post .= "<div id=\"phantrang\">{$phantrang}</div>";
	
    /*$danhmuc = $tc->Video($idMenu);
	while($row = mysql_fetch_array($danhmuc)){
		$view_post .= '
		<div class="item">
			<a href="'.$row_menu_one['url'].$row['name_rewrite'].'.html"><h2>'.$row['name'].'</h2></a>
			<img src="'.url_video_thumb_image.$row['url_hinh'].'" alt="'.$row['name'].'" />
			<h5>'.$row['description'].'</h5>
		</div>';
	}*/
}else{
	$view_post .= '<h1>'.$row_detail['name'].'</h1><br />
	<div id="frmvideo"><iframe id="video" src="'.$row_detail['link_video'].'?autoplay=1&origin=http://'.$domain.'&rel=0" frameborder="0"></iframe></div><br />
	<div id="noidung" style="margin:0 10px">'.$row_detail['content'].'</div>
	';
}
$view_post .= '</div><div style="clear:both; height:1px"></div></div>';
